package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.AssetsCollectMapper;
import com.ruoyi.ora.domain.AssetsCollect;
import com.ruoyi.ora.service.IAssetsCollectService;

/**
 * 收藏Service业务层处理
 * 
 * @author liuwp
 * @date 2025-03-20
 */
@Service
public class AssetsCollectServiceImpl implements IAssetsCollectService 
{
    @Autowired
    private AssetsCollectMapper assetsCollectMapper;

    /**
     * 查询收藏
     * 
     * @param id 收藏主键
     * @return 收藏
     */
    @Override
    public AssetsCollect selectAssetsCollectById(Long id)
    {
        return assetsCollectMapper.selectAssetsCollectById(id);
    }

    /**
     * 查询收藏列表
     * 
     * @param assetsCollect 收藏
     * @return 收藏
     */
    @Override
    public List<AssetsCollect> selectAssetsCollectList(AssetsCollect assetsCollect)
    {
        return assetsCollectMapper.selectAssetsCollectList(assetsCollect);
    }

    /**
     * 根据业务主键查询一条记录：收藏
     *
     * @param assetsCollect 收藏
     * @return 收藏
     */
    @Override
    public AssetsCollect selectOneAssetsCollect(AssetsCollect assetsCollect)
    {
        return assetsCollectMapper.selectOneAssetsCollect(assetsCollect);
    }

    /**
     * 新增收藏
     * 
     * @param assetsCollect 收藏
     * @return 结果
     */
    @Override
    public int insertAssetsCollect(AssetsCollect assetsCollect)
    {
        assetsCollect.setCreateTime(DateUtils.getNowDate());
        return assetsCollectMapper.insertAssetsCollect(assetsCollect);
    }

    /**
     * 修改收藏
     * 
     * @param assetsCollect 收藏
     * @return 结果
     */
    @Override
    public int updateAssetsCollect(AssetsCollect assetsCollect)
    {
        return assetsCollectMapper.updateAssetsCollect(assetsCollect);
    }

    @Override
    public int updateAssetsCollectCondition(AssetsCollect assetsCollect, AssetsCollect assetsCollectCondition)
    {
        return assetsCollectMapper.updateAssetsCollectCondition(assetsCollect, assetsCollectCondition);
    }

    /**
     * 批量删除收藏
     * 
     * @param ids 需要删除的收藏主键
     * @return 结果
     */
    @Override
    public int deleteAssetsCollectByIds(Long[] ids)
    {
        return assetsCollectMapper.deleteAssetsCollectByIds(ids);
    }

    /**
     * 删除收藏信息
     * 
     * @param id 收藏主键
     * @return 结果
     */
    @Override
    public int deleteAssetsCollectById(Long id)
    {
        return assetsCollectMapper.deleteAssetsCollectById(id);
    }

    /**
     * 条件删除收藏
     *
     * @param assetsCollect 收藏
     * @return 结果
     */
    @Override
    public int deleteAssetsCollectByCondition(AssetsCollect assetsCollect)
    {
        return assetsCollectMapper.deleteAssetsCollectByCondition(assetsCollect);
    }

}
